<%--
  Created by IntelliJ IDEA.
  User: mrcat
  Date: 2020-01-17
  Time: 22:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>简历列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/lib/bootstrap/css/bootstrap.css" rel="stylesheet">
    <script src="/lib/jquery-3.4.1.min.js"></script>
    <script src="/lib/bootstrap/js/bootstrap.js"></script>
    <style>
        htmo, body {
            height: 100%
        }
    </style>
    <script>
        function remove(id) {
            if (confirm("确认删除该简历？")) {
                location.href = "/resume/delete/" + id;
            }
        }
    </script>
</head>
<body class="bg-secondary">
<div class="container h-100 d-flex justify-content-center">
    <div class=" my-auto">
        <div style="text-align: right">
            <button class="btn btn-primary" onclick="location.href='create'">新建</button>
            &nbsp;
            <button class="btn btn-primary" onclick="location.href='/logout'">注销</button>
        </div>
        <table class="table table-hover" style="width: 1000px;margin-top: 10px">
            <thead class="thead-dark">
            <tr>
                <th style="width: 100px">ID</th>
                <th>姓名</th>
                <th style="width: 150px">操作</th>
            </tr>
            </thead>
            <tbody class="bg-white">
            <c:forEach items="${list}" var="r">
                <tr>
                    <td>
                            ${r.id}
                    </td>
                    <td>
                            ${r.name}
                    </td>
                    <td>
                        <a href="#" class="font-weight-bold" onclick="remove(${r.id})">删除</a>
                        <a href="/resume/${r.id}" class="font-weight-bold">编辑</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
